package pe.com.cineplanet.dao.impl;

import java.util.List;


import org.springframework.jdbc.core.JdbcTemplate;

import pe.com.cineplanet.bean.Rubro;
import pe.com.cineplanet.dao.RubroDAO;
import pe.com.cineplanet.dao.mapper.RubroMapper;



public class RubroImpl implements RubroDAO  {

	
	protected JdbcTemplate jdbcTemplate;
	
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	

	@SuppressWarnings("unchecked")
	public List<Rubro> selectList() {
		StringBuffer strQuery= new StringBuffer();
		strQuery.append("SELECT r.id_rubro, r.descrip FROM rubros r ");
	
		return jdbcTemplate.query(strQuery.toString(), new RubroMapper());
		

	}
	
	
}
